package TestDemo.example.controller;

import TestDemo.example.pojo.PageResult;
import TestDemo.example.pojo.Result;
import TestDemo.example.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogService logServiceImpl;
    @GetMapping("/page")
    public Result getLogList(@RequestParam(defaultValue = "1") Integer page
                                , @RequestParam(defaultValue="10") Integer pageSize){
        log.info("分页查询日志列表{}————{}",page,pageSize);
        PageResult pageResult = logServiceImpl.getLogList(page, pageSize);
        return Result.success(pageResult);
    }
}
